import React from 'react';
import {
    View,
    Text,
    TouchableOpacity,
    Dimensions, ScrollView,
} from 'react-native';
import NavigationBar from '../../common/NavigationBar';
import GlobalStyles from '../../common/styles/GlobalStyles';
import styles from "../MakeCaseDocumentForm/styles";

export default class TextDetail extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            detail: '',
        };
    }
    componentDidMount() {
        const {detail} = this.props.navigation.state.params;
        this.setState({
            detail:detail
        })
    }
    render() {
        const {navigation} = this.props;
        const {detail} = this.state;
        const detail1 = detail.replace(/\s/ig, '');
        const detail2 = detail1.replace(/&emsp;/ig, '');
        const detail3 = detail2.replace(/&nbsp;/ig, '');
        const detail4 = detail3.replace(/<.+?>/ig, '');

        return (
            <View style={GlobalStyles.pageContainer}>
                {/* 自定义顶部导航条 */}
                <NavigationBar
                    navigation={navigation}
                    headerBackTitle={'文本详情'}
                />
                <View style={[GlobalStyles.innerTabPanel,{flexDirection: 'column',flex: 1}]}>
                    <ScrollView
                        style={{flex: 1}}
                        automaticallyAdjustContentInsets={false}
                        showsHorizontalScrollIndicator={false}
                        showsVerticalScrollIndicator={false}>
                        {/*<Text>{detail}</Text>*/}
                        <Text>{detail4}</Text>
                    </ScrollView>
                </View>
            </View>

        );
    }
}